package com.oxygen.design.proxy.interfaces.impl;

import com.oxygen.design.proxy.interfaces.Image;

/**
 * @author wangjie
 * @title: ProxyImage
 * @description: TODO
 * @date 2022/3/30 21:20
 **/
public class ProxyImage implements Image {

    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (realImage == null) {
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}